package org.chaiyi.template.core.common.common;

/**
 * 自动注册的bean的名称统一由此处生成
 *
 * @author Gong.Yang
 */
public class BeanNameManage {

    public static String getContractInfoName(Class<?> iService) {
        return "info" + iService.getSimpleName();
    }

    public static String getRepositoryName(Class<?> entityClass) {
        String entitySimpleName = entityClass.getSimpleName();
        String beanName = entitySimpleName.substring(0, 1).toLowerCase()
                + entitySimpleName.substring(1)
                + "Repository";

        return beanName;
    }

    public static String getSupportCacheName(Class<?> supportClass) {
        String simpleName = supportClass.getSimpleName();
        String beanName = simpleName.substring(0, 1).toLowerCase()
                + simpleName.substring(1)
                + "SupporterCache";

        return beanName;
    }
}
